package com.lmiot.xyclick.Activity;

import android.app.Dialog;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.PowerManager;
import android.support.v7.widget.SwitchCompat;
import android.view.View;
import android.widget.ImageView;
import android.widget.RadioButton;
import android.widget.RelativeLayout;
import android.widget.SeekBar;
import android.widget.TextView;
import com.lmiot.xyclick.App.MyApp;
import com.lmiot.xyclick.Bean.SQL.ActionBean;
import com.lmiot.xyclick.Bean.SQL.ActionBeanSqlUtil;
import com.lkx.liandianqinew.R;
import com.lmiot.xyclick.Util.DataUtil;
import com.lmiot.xyclick.Util.DoubleUtils;
import com.lmiot.xyclick.Util.DpUtil;
import com.lmiot.xyclick.Util.EditDialogUtil;
import com.lmiot.xyclick.Util.LayoutDialogUtil;
import com.lmiot.xyclick.Util.LogUtil;
import com.xiaoyi.intentsdklibrary.SDK.Action.ActionAsSDK;
import com.yhao.floatwindow.ChangViewBean;
import com.yhao.floatwindow.FloatUtil;
import com.youyi.yypermissionlibrary.SDK.OnPerListener;
import com.youyi.yypermissionlibrary.SDK.YYPerUtils;
import com.youyi.yyviewsdklibrary.Dialog.util.ToastUtil;
import com.youyi.yyviewsdklibrary.View.MyNameDetailView;
import com.youyi.yyviewsdklibrary.View.TitleBarView;
import com.zhy.android.percent.support.PercentLayoutHelper;
import com.zhy.android.percent.support.PercentRelativeLayout;
import java.util.ArrayList;
import java.util.List;
import org.greenrobot.eventbus.EventBus;
import org.opencv.OpenCVSDK;

public class AutoSettingActivity extends BaseActivity implements View.OnClickListener {
    private static final String TAG = "AutoSettingActivity";
    private Dialog mDialog;
    PercentRelativeLayout mIdAutoLayout;
    SwitchCompat mIdAutoSwitch;
    RadioButton mIdBt1;
    RadioButton mIdBt2;
    RadioButton mIdBt3;
    RadioButton mIdBt4;
    RadioButton mIdBt5;
    PercentRelativeLayout mIdCallLayout;
    SwitchCompat mIdCallSwitch;
    PercentRelativeLayout mIdChangeLayout;
    SwitchCompat mIdChangeSwitch;
    TextView mIdCicktimeValue;
    PercentRelativeLayout mIdClicktimeLayout;
    SeekBar mIdClicktimeSeekbar;
    PercentRelativeLayout mIdCloseAllvibrateLayout;
    SwitchCompat mIdCloseAllvibrateSwitch;
    SwitchCompat mIdCreateSwitch;
    PercentRelativeLayout mIdCreatenoticLayout;
    PercentRelativeLayout mIdDelayLayout;
    SwitchCompat mIdDelaySwitch;
    ImageView mIdFloatEnter;
    PercentRelativeLayout mIdFloatHideLayout;
    SwitchCompat mIdFloatHideSwitch;
    ImageView mIdFloatpointImg;
    SeekBar mIdFloatpointSeekbar;
    PercentRelativeLayout mIdForLayout;
    SwitchCompat mIdForSwitch;
    ImageView mIdKeyEnter;
    PercentRelativeLayout mIdKeyLayout;
    TextView mIdKeyValue;
    PercentRelativeLayout mIdLockLayout;
    SwitchCompat mIdLockSwitch;
    PercentRelativeLayout mIdPicLayout;
    SeekBar mIdPicSeekbar;
    TextView mIdPicValue;
    PercentRelativeLayout mIdRandomLayout;
    SwitchCompat mIdRandomSwitch;
    MyNameDetailView mIdSave;
    PercentRelativeLayout mIdShortcutLayout;
    SwitchCompat mIdShortcutSwitch;
    PercentRelativeLayout mIdShowClickviewLayout;
    SwitchCompat mIdShowClickviewSwitch;
    PercentRelativeLayout mIdShowxyLayout;
    SwitchCompat mIdShowxySwitch;
    PercentRelativeLayout mIdSlipLayout;
    SeekBar mIdSlipSeekbar;
    TextView mIdSlipValue;
    TitleBarView mIdTitleBar;
    PercentRelativeLayout mIdTrackLayout;
    SwitchCompat mIdTrackSwitch;
    PercentRelativeLayout mIdVibrateLayout;
    SwitchCompat mIdVibrateSwitch;

    /* access modifiers changed from: protected */
    @Override // android.support.v4.app.SupportActivity, com.lmiot.xyclick.Activity.BaseActivity, android.support.v7.app.AppCompatActivity, android.support.v4.app.FragmentActivity
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(R.layout.activity_auto_setting);
        initView();
        init();
        setSeekbar();
        this.mIdSave.setOnItemClickListener(new MyNameDetailView.onItemClickListener() {
            /* class com.lmiot.xyclick.Activity.AutoSettingActivity.AnonymousClass1 */

            @Override // com.youyi.yyviewsdklibrary.View.MyNameDetailView.onItemClickListener
            public void onItemClick(View view) {
            }

            @Override // com.youyi.yyviewsdklibrary.View.MyNameDetailView.onItemClickListener
            public void onChecked(boolean z) {
                if (!YYPerUtils.hasOp()) {
                    YYPerUtils.openOp();
                    AutoSettingActivity.this.mIdSave.setChecked(false);
                } else if (!z) {
                    DoubleUtils.setSaveBitmap(MyApp.getContext(), "");
                    DoubleUtils.getInstance().stop();
                } else if (DataUtil.getShowTip(MyApp.getContext())) {
                    AutoSettingActivity.this.openWall();
                } else {
                    LayoutDialogUtil.shwoTip(AutoSettingActivity.this, new LayoutDialogUtil.OnResultClickListener() {
                        /* class com.lmiot.xyclick.Activity.AutoSettingActivity.AnonymousClass1.AnonymousClass1 */

                        @Override // com.lmiot.xyclick.Util.LayoutDialogUtil.OnResultClickListener
                        public void result(boolean z) {
                            if (z) {
                                DataUtil.setShowTip(MyApp.getContext(), true);
                                AutoSettingActivity.this.openWall();
                                return;
                            }
                            AutoSettingActivity.this.mIdSave.setChecked(false);
                        }
                    });
                }
            }
        });
    }

    private void setSeekbar() {
        this.mIdPicSeekbar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
            /* class com.lmiot.xyclick.Activity.AutoSettingActivity.AnonymousClass2 */

            public void onStartTrackingTouch(SeekBar seekBar) {
            }

            public void onStopTrackingTouch(SeekBar seekBar) {
            }

            public void onProgressChanged(SeekBar seekBar, int i, boolean z) {
                TextView textView = AutoSettingActivity.this.mIdPicValue;
                textView.setText(i + "%");
                OpenCVSDK.getInstance().setPicLike(AutoSettingActivity.this, i);
            }
        });
        this.mIdSlipSeekbar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
            /* class com.lmiot.xyclick.Activity.AutoSettingActivity.AnonymousClass3 */

            public void onStartTrackingTouch(SeekBar seekBar) {
            }

            public void onStopTrackingTouch(SeekBar seekBar) {
            }

            public void onProgressChanged(SeekBar seekBar, int i, boolean z) {
                FloatUtil.setSlip(AutoSettingActivity.this, i);
                TextView textView = AutoSettingActivity.this.mIdSlipValue;
                textView.setText(i + "ms");
            }
        });
        this.mIdClicktimeSeekbar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
            /* class com.lmiot.xyclick.Activity.AutoSettingActivity.AnonymousClass4 */

            public void onStartTrackingTouch(SeekBar seekBar) {
            }

            public void onStopTrackingTouch(SeekBar seekBar) {
            }

            public void onProgressChanged(SeekBar seekBar, int i, boolean z) {
                FloatUtil.setClickTime(AutoSettingActivity.this, i);
                TextView textView = AutoSettingActivity.this.mIdCicktimeValue;
                textView.setText(i + "ms");
            }
        });
        this.mIdFloatpointSeekbar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
            /* class com.lmiot.xyclick.Activity.AutoSettingActivity.AnonymousClass5 */

            public void onStartTrackingTouch(SeekBar seekBar) {
            }

            public void onStopTrackingTouch(SeekBar seekBar) {
            }

            public void onProgressChanged(SeekBar seekBar, int i, boolean z) {
                FloatUtil.setFloatPoint(AutoSettingActivity.this, i);
                int dip2px = DpUtil.dip2px(AutoSettingActivity.this, (float) (((i * 30) / 100) + 20));
                RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(dip2px, dip2px);
                layoutParams.addRule(11);
                layoutParams.rightMargin = 80;
                AutoSettingActivity.this.mIdFloatpointImg.setLayoutParams(layoutParams);
                EventBus.getDefault().post(new ChangViewBean("actionView"));
            }
        });
    }

    private void init() {
        this.mIdTitleBar.setOnItemClickListener(new TitleBarView.onItemClickListener() {
            /* class com.lmiot.xyclick.Activity.AutoSettingActivity.AnonymousClass6 */

            @Override // com.youyi.yyviewsdklibrary.View.TitleBarView.onItemClickListener
            public void onTitleClick(View view) {
            }

            @Override // com.youyi.yyviewsdklibrary.View.TitleBarView.onItemClickListener
            public void onBackClick(View view) {
                AutoSettingActivity.this.finish();
            }

            @Override // com.youyi.yyviewsdklibrary.View.TitleBarView.onItemClickListener
            public void onMenuClick(View view) {
                AutoSettingActivity.this.showResetDialog();
            }
        });
    }

    /* access modifiers changed from: private */
    /* access modifiers changed from: public */
    private void showResetDialog() {
        Dialog dialog = this.mDialog;
        if (dialog != null) {
            dialog.dismiss();
        }
        Dialog createSysDailog = LayoutDialogUtil.createSysDailog(this, R.layout.dialog_reset_layout);
        this.mDialog = createSysDailog;
        ((TextView) createSysDailog.findViewById(R.id.tv_sure)).setOnClickListener(new View.OnClickListener() {
            /* class com.lmiot.xyclick.Activity.AutoSettingActivity.AnonymousClass7 */

            public void onClick(View view) {
                AutoSettingActivity.this.resetData();
                AutoSettingActivity.this.showAllData();
                AutoSettingActivity.this.mDialog.dismiss();
            }
        });
        ((TextView) this.mDialog.findViewById(R.id.tv_cancel)).setOnClickListener(new View.OnClickListener() {
            /* class com.lmiot.xyclick.Activity.AutoSettingActivity.AnonymousClass8 */

            public void onClick(View view) {
                AutoSettingActivity.this.mDialog.dismiss();
            }
        });
    }

    /* access modifiers changed from: private */
    /* access modifiers changed from: public */
    private void resetData() {
        FloatUtil.setFront(this, false);
        FloatUtil.setAutoMs(this, false);
        DataUtil.setTrackImg(this, true);
        ActionAsSDK.setSlipeRandom(this, false);
        ActionAsSDK.setWaitTime(this, true);
        ActionAsSDK.setDelayUnitMs(this, false);
        ActionAsSDK.setCreateAutoNotic(this, false);
        ActionAsSDK.setCloseAllVibrate(this, false);
        FloatUtil.setAutoVibrate(this, true);
        FloatUtil.setHideFloat(this, false);
        FloatUtil.setTopTip(this, 4);
        FloatUtil.setAutoShare(this, false);
        FloatUtil.setLockStop(this, false);
        FloatUtil.setPauseCall(this, true);
        FloatUtil.setClickView(this, true);
        FloatUtil.setChangeData(this, true);
        OpenCVSDK.getInstance().setPicLike(this, 50);
        FloatUtil.setSlip(this, 800);
        FloatUtil.setClickTime(this, 10);
        FloatUtil.setFloatPoint(this, 50);
        FloatUtil.setStopAuto(this, DataUtil.KYE_LONG_VOLUEM_DES);
    }

    @Override // com.lmiot.xyclick.Activity.BaseActivity, android.support.v4.app.FragmentActivity
    public void onResume() {
        super.onResume();
        this.mIdSave.setChecked(DoubleUtils.getInstance().isRunning(MyApp.getContext(), getPackageName()));
        showAllData();
    }

    /* access modifiers changed from: private */
    /* access modifiers changed from: public */
    private void showAllData() {
        this.mIdAutoSwitch.setChecked(FloatUtil.getAutoMs(this));
        this.mIdTrackSwitch.setChecked(DataUtil.getTrackImg(this));
        this.mIdRandomSwitch.setChecked(ActionAsSDK.getSlipeRandom(this));
        this.mIdForSwitch.setChecked(ActionAsSDK.getWaitTime(this));
        this.mIdDelaySwitch.setChecked(ActionAsSDK.getDelayUnitMs(this));
        this.mIdCreateSwitch.setChecked(ActionAsSDK.getCreateAutoNotic(this));
        this.mIdCloseAllvibrateSwitch.setChecked(ActionAsSDK.getCloseAllVibrate(this));
        this.mIdVibrateSwitch.setChecked(FloatUtil.getAutoVibrate(this));
        this.mIdFloatHideSwitch.setChecked(FloatUtil.getHideFloat(this));
        this.mIdShortcutSwitch.setChecked(FloatUtil.getAutoShare(this));
        this.mIdLockSwitch.setChecked(FloatUtil.getLockStop(this));
        int topTip = FloatUtil.getTopTip(this);
        if (topTip == 1) {
            this.mIdBt1.setChecked(true);
        } else if (topTip == 2) {
            this.mIdBt2.setChecked(true);
        } else if (topTip == 3) {
            this.mIdBt3.setChecked(true);
        } else if (topTip == 4) {
            this.mIdBt4.setChecked(true);
        } else if (topTip == 5) {
            this.mIdBt5.setChecked(true);
        }
        this.mIdCallSwitch.setChecked(FloatUtil.getPauseCall(this));
        this.mIdShowClickviewSwitch.setChecked(FloatUtil.getClickView(this));
        this.mIdChangeSwitch.setChecked(FloatUtil.getChangeData(this));
        this.mIdPicSeekbar.setProgress(OpenCVSDK.getInstance().getPicLike(this));
        TextView textView = this.mIdPicValue;
        textView.setText(OpenCVSDK.getInstance().getPicLike(this) + "%");
        int slip = FloatUtil.getSlip(this);
        this.mIdSlipSeekbar.setProgress(slip);
        TextView textView2 = this.mIdSlipValue;
        textView2.setText(slip + "ms");
        int clickTime = FloatUtil.getClickTime(this);
        TextView textView3 = this.mIdCicktimeValue;
        textView3.setText(clickTime + "ms");
        this.mIdClicktimeSeekbar.setProgress(clickTime);
        int floatPoint = FloatUtil.getFloatPoint(this);
        this.mIdFloatpointSeekbar.setProgress(floatPoint);
        int dip2px = DpUtil.dip2px(this, (float) (((floatPoint * 30) / 100) + 20));
        RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(dip2px, dip2px);
        layoutParams.addRule(11);
        layoutParams.rightMargin = 80;
        this.mIdFloatpointImg.setLayoutParams(layoutParams);
        showdKeyata();
    }

    /* access modifiers changed from: private */
    /* access modifiers changed from: public */
    private void showdKeyata() {
        String stopAuto = FloatUtil.getStopAuto(this);
        LogUtil.d(TAG, "stopAuto:" + stopAuto);
        stopAuto.hashCode();
        char c = 65535;
        switch (stopAuto.hashCode()) {
            case -1945307511:
                if (stopAuto.equals(DataUtil.KYE_LONG_VOLUEM_DES)) {
                    c = 0;
                    break;
                }
                break;
            case -1584530868:
                if (stopAuto.equals(DataUtil.KYE_LONG_VOLUEM_ADD)) {
                    c = 1;
                    break;
                }
                break;
            case -758986233:
                if (stopAuto.equals(DataUtil.KYE_LONG_HOME)) {
                    c = 2;
                    break;
                }
                break;
            case -279675091:
                if (stopAuto.equals(DataUtil.KYE_VOLUEM_ADD)) {
                    c = 3;
                    break;
                }
                break;
            case 534626691:
                if (stopAuto.equals(DataUtil.KYE_LONG_RECNET)) {
                    c = 4;
                    break;
                }
                break;
            case 1082991082:
                if (stopAuto.equals(DataUtil.KYE_VOLUEM_DES)) {
                    c = 5;
                    break;
                }
                break;
            case 1673530895:
                if (stopAuto.equals(DataUtil.KYE_LONG_BACK)) {
                    c = 6;
                    break;
                }
                break;
        }
        switch (c) {
            case 0:
                this.mIdKeyValue.setText("长按音量-键");
                return;
            case 1:
                this.mIdKeyValue.setText("长按音量+键");
                return;
            case 2:
                this.mIdKeyValue.setText("长按Home键");
                return;
            case 3:
                this.mIdKeyValue.setText("短按音量+键");
                return;
            case 4:
                this.mIdKeyValue.setText("长按最近任务键");
                return;
            case 5:
                this.mIdKeyValue.setText("短按音量-键");
                return;
            case 6:
                this.mIdKeyValue.setText("长按返回键");
                return;
            default:
                this.mIdKeyValue.setText("不使用快捷键");
                return;
        }
    }

    private void changeMS() {
        ArrayList arrayList = new ArrayList();
        arrayList.add(new EditDialogUtil.MenuBean(R.drawable.auto_time, "所有时间除以1000", null));
        arrayList.add(new EditDialogUtil.MenuBean(R.drawable.auto_time, "所有时间乘以1000", null));
        EditDialogUtil.getInstance().buttomMenuDialog(this, 10, arrayList, new EditDialogUtil.OnMenuClickListener() {
            /* class com.lmiot.xyclick.Activity.AutoSettingActivity.AnonymousClass9 */

            @Override // com.lmiot.xyclick.Util.EditDialogUtil.OnMenuClickListener
            public void click(int i) {
                if (i == 0) {
                    List<ActionBean> searchAll = ActionBeanSqlUtil.getInstance().searchAll();
                    for (ActionBean actionBean : searchAll) {
                        int delay = actionBean.getDelay();
                        if (delay != 0) {
                            int i2 = delay / 1000;
                            if (i2 == 0) {
                                i2 = 1;
                            }
                            actionBean.setDelay(i2);
                        }
                    }
                    ActionBeanSqlUtil.getInstance().addList01(searchAll);
                    ToastUtil.success("转换成功！");
                } else if (i == 1) {
                    List<ActionBean> searchAll2 = ActionBeanSqlUtil.getInstance().searchAll();
                    for (ActionBean actionBean2 : searchAll2) {
                        int delay2 = actionBean2.getDelay();
                        if (delay2 != 0) {
                            actionBean2.setDelay(delay2 * 1000);
                        }
                    }
                    ActionBeanSqlUtil.getInstance().addList01(searchAll2);
                    ToastUtil.success("转换成功！");
                }
            }
        }, false, false);
    }

    private void resetAPP() {
        LayoutDialogUtil.showSureDialog(this, "温馨提示", "设置完成后需要重启APP才可以生效，\n您现在要重启APP么?", true, true, "稍后重启", "立即重启", new LayoutDialogUtil.OnResultClickListener() {
            /* class com.lmiot.xyclick.Activity.AutoSettingActivity.AnonymousClass10 */

            @Override // com.lmiot.xyclick.Util.LayoutDialogUtil.OnResultClickListener
            public void result(boolean z) {
                if (z) {
                    MyApp.getInstance().exit();
                }
            }
        });
    }

    public void gotoPowerSet() {
        try {
            PowerManager powerManager = (PowerManager) getSystemService(POWER_SERVICE);
            boolean z = false;
            if (Build.VERSION.SDK_INT >= 23) {
                z = powerManager.isIgnoringBatteryOptimizations(getPackageName());
            }
            LogUtil.d(TAG, "hasIgnored:" + z);
            if (!z) {
                Intent intent = new Intent("android.settings.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS");
                intent.setData(Uri.parse("package:" + getPackageName()));
                startActivity(intent);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    private void choseDialog() {
        ArrayList arrayList = new ArrayList();
        arrayList.add(new EditDialogUtil.MenuBean(R.drawable.add_volume, "长按音量+键", null));
        arrayList.add(new EditDialogUtil.MenuBean(R.drawable.cutdown_volume, "长按音量-键", null));
        arrayList.add(new EditDialogUtil.MenuBean(R.drawable.add_volume, "短按音量+键", null));
        arrayList.add(new EditDialogUtil.MenuBean(R.drawable.cutdown_volume, "短按音量-键", null));
        arrayList.add(new EditDialogUtil.MenuBean(R.drawable.key_home, "长按Home键", null));
        arrayList.add(new EditDialogUtil.MenuBean(R.drawable.key_back, "长按返回键", null));
        arrayList.add(new EditDialogUtil.MenuBean(R.drawable.key_task, "长按最近任务键", null));
        arrayList.add(new EditDialogUtil.MenuBean(R.drawable.no_use, "不使用快捷键", null));
        EditDialogUtil.getInstance().buttomMenuDialog(this, 7, arrayList, new EditDialogUtil.OnMenuClickListener() {
            /* class com.lmiot.xyclick.Activity.AutoSettingActivity.AnonymousClass11 */

            @Override // com.lmiot.xyclick.Util.EditDialogUtil.OnMenuClickListener
            public void click(int i) {
                switch (i) {
                    case 0:
                        FloatUtil.setStopAuto(AutoSettingActivity.this, DataUtil.KYE_LONG_VOLUEM_ADD);
                        break;
                    case 1:
                        FloatUtil.setStopAuto(AutoSettingActivity.this, DataUtil.KYE_LONG_VOLUEM_DES);
                        break;
                    case 2:
                        FloatUtil.setStopAuto(AutoSettingActivity.this, DataUtil.KYE_VOLUEM_ADD);
                        break;
                    case 3:
                        FloatUtil.setStopAuto(AutoSettingActivity.this, DataUtil.KYE_VOLUEM_DES);
                        break;
                    case 4:
                        FloatUtil.setStopAuto(AutoSettingActivity.this, DataUtil.KYE_LONG_HOME);
                        break;
                    case 5:
                        FloatUtil.setStopAuto(AutoSettingActivity.this, DataUtil.KYE_LONG_BACK);
                        break;
                    case 6:
                        FloatUtil.setStopAuto(AutoSettingActivity.this, DataUtil.KYE_LONG_RECNET);
                        break;
                    case 7:
                        FloatUtil.setStopAuto(AutoSettingActivity.this, "");
                        break;
                }
                AutoSettingActivity.this.showdKeyata();
            }
        }, false, true);
    }

    private void initView() {
        this.mIdTitleBar = (TitleBarView) findViewById(R.id.id_title_bar);
        this.mIdSave = (MyNameDetailView) findViewById(R.id.id_save);
        this.mIdBt1 = (RadioButton) findViewById(R.id.id_bt1);
        this.mIdBt2 = (RadioButton) findViewById(R.id.id_bt2);
        this.mIdBt3 = (RadioButton) findViewById(R.id.id_bt3);
        this.mIdBt4 = (RadioButton) findViewById(R.id.id_bt4);
        this.mIdBt5 = (RadioButton) findViewById(R.id.id_bt5);
        this.mIdAutoSwitch = (SwitchCompat) findViewById(R.id.id_auto_switch);
        this.mIdFloatEnter = (ImageView) findViewById(R.id.id_float_enter);
        this.mIdAutoLayout = (PercentRelativeLayout) findViewById(R.id.id_auto_layout);
        this.mIdShowxySwitch = (SwitchCompat) findViewById(R.id.id_showxy_switch);
        this.mIdShowxyLayout = (PercentRelativeLayout) findViewById(R.id.id_showxy_layout);
        this.mIdTrackSwitch = (SwitchCompat) findViewById(R.id.id_track_switch);
        this.mIdTrackLayout = (PercentRelativeLayout) findViewById(R.id.id_track_layout);
        this.mIdVibrateSwitch = (SwitchCompat) findViewById(R.id.id_vibrate_switch);
        this.mIdVibrateLayout = (PercentRelativeLayout) findViewById(R.id.id_vibrate_layout);
        this.mIdShortcutSwitch = (SwitchCompat) findViewById(R.id.id_shortcut_switch);
        this.mIdShortcutLayout = (PercentRelativeLayout) findViewById(R.id.id_shortcut_layout);
        this.mIdFloatHideSwitch = (SwitchCompat) findViewById(R.id.id_float_hide_switch);
        this.mIdFloatHideLayout = (PercentRelativeLayout) findViewById(R.id.id_float_hide_layout);
        this.mIdShowClickviewSwitch = (SwitchCompat) findViewById(R.id.id_show_clickview_switch);
        this.mIdShowClickviewLayout = (PercentRelativeLayout) findViewById(R.id.id_show_clickview_layout);
        this.mIdChangeSwitch = (SwitchCompat) findViewById(R.id.id_change_switch);
        this.mIdChangeLayout = (PercentRelativeLayout) findViewById(R.id.id_change_layout);
        this.mIdLockSwitch = (SwitchCompat) findViewById(R.id.id_lock_switch);
        this.mIdLockLayout = (PercentRelativeLayout) findViewById(R.id.id_lock_layout);
        this.mIdCallSwitch = (SwitchCompat) findViewById(R.id.id_call_switch);
        this.mIdCallLayout = (PercentRelativeLayout) findViewById(R.id.id_call_layout);
        this.mIdRandomSwitch = (SwitchCompat) findViewById(R.id.id_random_switch);
        this.mIdRandomLayout = (PercentRelativeLayout) findViewById(R.id.id_random_layout);
        this.mIdForSwitch = (SwitchCompat) findViewById(R.id.id_for_switch);
        this.mIdForLayout = (PercentRelativeLayout) findViewById(R.id.id_for_layout);
        this.mIdDelaySwitch = (SwitchCompat) findViewById(R.id.id_delay_switch);
        this.mIdDelayLayout = (PercentRelativeLayout) findViewById(R.id.id_delay_layout);
        this.mIdCreateSwitch = (SwitchCompat) findViewById(R.id.id_create_switch);
        this.mIdCreatenoticLayout = (PercentRelativeLayout) findViewById(R.id.id_createnotic_layout);
        this.mIdCloseAllvibrateSwitch = (SwitchCompat) findViewById(R.id.id_close_allvibrate_switch);
        this.mIdCloseAllvibrateLayout = (PercentRelativeLayout) findViewById(R.id.id_close_allvibrate_layout);
        this.mIdKeyValue = (TextView) findViewById(R.id.id_key_value);
        this.mIdKeyEnter = (ImageView) findViewById(R.id.id_key_enter);
        this.mIdKeyLayout = (PercentRelativeLayout) findViewById(R.id.id_key_layout);
        this.mIdPicValue = (TextView) findViewById(R.id.id_pic_value);
        this.mIdPicSeekbar = (SeekBar) findViewById(R.id.id_pic_seekbar);
        this.mIdPicLayout = (PercentRelativeLayout) findViewById(R.id.id_pic_layout);
        this.mIdSlipValue = (TextView) findViewById(R.id.id_slip_value);
        this.mIdSlipSeekbar = (SeekBar) findViewById(R.id.id_slip_seekbar);
        this.mIdSlipLayout = (PercentRelativeLayout) findViewById(R.id.id_slip_layout);
        this.mIdCicktimeValue = (TextView) findViewById(R.id.id_cicktime_value);
        this.mIdClicktimeSeekbar = (SeekBar) findViewById(R.id.id_clicktime_seekbar);
        this.mIdClicktimeLayout = (PercentRelativeLayout) findViewById(R.id.id_clicktime_layout);
        this.mIdFloatpointImg = (ImageView) findViewById(R.id.id_floatpoint_img);
        this.mIdFloatpointSeekbar = (SeekBar) findViewById(R.id.id_floatpoint_seekbar);
        this.mIdBt1.setOnClickListener(this);
        this.mIdBt2.setOnClickListener(this);
        this.mIdBt3.setOnClickListener(this);
        this.mIdBt4.setOnClickListener(this);
        this.mIdBt5.setOnClickListener(this);
        this.mIdAutoSwitch.setOnClickListener(this);
        this.mIdAutoLayout.setOnClickListener(this);
        this.mIdShowxySwitch.setOnClickListener(this);
        this.mIdShowxyLayout.setOnClickListener(this);
        this.mIdTrackSwitch.setOnClickListener(this);
        this.mIdTrackLayout.setOnClickListener(this);
        this.mIdVibrateSwitch.setOnClickListener(this);
        this.mIdVibrateLayout.setOnClickListener(this);
        this.mIdShortcutSwitch.setOnClickListener(this);
        this.mIdShortcutLayout.setOnClickListener(this);
        this.mIdFloatHideSwitch.setOnClickListener(this);
        this.mIdFloatHideLayout.setOnClickListener(this);
        this.mIdShowClickviewSwitch.setOnClickListener(this);
        this.mIdShowClickviewLayout.setOnClickListener(this);
        this.mIdChangeSwitch.setOnClickListener(this);
        this.mIdChangeLayout.setOnClickListener(this);
        this.mIdLockSwitch.setOnClickListener(this);
        this.mIdLockLayout.setOnClickListener(this);
        this.mIdCallSwitch.setOnClickListener(this);
        this.mIdCallLayout.setOnClickListener(this);
        this.mIdRandomSwitch.setOnClickListener(this);
        this.mIdRandomLayout.setOnClickListener(this);
        this.mIdForSwitch.setOnClickListener(this);
        this.mIdForLayout.setOnClickListener(this);
        this.mIdDelaySwitch.setOnClickListener(this);
        this.mIdDelayLayout.setOnClickListener(this);
        this.mIdCreateSwitch.setOnClickListener(this);
        this.mIdCreatenoticLayout.setOnClickListener(this);
        this.mIdCloseAllvibrateSwitch.setOnClickListener(this);
        this.mIdCloseAllvibrateLayout.setOnClickListener(this);
        this.mIdKeyLayout.setOnClickListener(this);
    }

    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.id_auto_layout /*{ENCODED_INT: 2131296474}*/:
                if (this.mIdAutoSwitch.isChecked()) {
                    this.mIdAutoSwitch.setChecked(false);
                    FloatUtil.setAutoMs(this, false);
                    return;
                }
                this.mIdAutoSwitch.setChecked(true);
                FloatUtil.setAutoMs(this, true);
                return;
            case R.id.id_auto_switch /*{ENCODED_INT: 2131296476}*/:
                if (this.mIdAutoSwitch.isChecked()) {
                    FloatUtil.setAutoMs(this, true);
                    return;
                } else {
                    FloatUtil.setAutoMs(this, false);
                    return;
                }
            case R.id.id_bt1 /*{ENCODED_INT: 2131296506}*/:
                if (this.mIdBt1.isChecked()) {
                    FloatUtil.setTopTip(this, 1);
                    return;
                }
                return;
            case R.id.id_bt2 /*{ENCODED_INT: 2131296507}*/:
                if (this.mIdBt2.isChecked()) {
                    FloatUtil.setTopTip(this, 2);
                    return;
                }
                return;
            case R.id.id_bt3 /*{ENCODED_INT: 2131296508}*/:
                if (this.mIdBt3.isChecked()) {
                    FloatUtil.setTopTip(this, 3);
                    return;
                }
                return;
            case R.id.id_bt4 /*{ENCODED_INT: 2131296509}*/:
                if (this.mIdBt4.isChecked()) {
                    FloatUtil.setTopTip(this, 4);
                    return;
                }
                return;
            case R.id.id_bt5 /*{ENCODED_INT: 2131296510}*/:
                if (this.mIdBt5.isChecked()) {
                    FloatUtil.setTopTip(this, 5);
                    return;
                }
                return;
            case R.id.id_call_layout /*{ENCODED_INT: 2131296523}*/:
                if (this.mIdCallSwitch.isChecked()) {
                    this.mIdCallSwitch.setChecked(false);
                    FloatUtil.setPauseCall(this, false);
                    return;
                }
                this.mIdCallSwitch.setChecked(true);
                FloatUtil.setPauseCall(this, true);
                return;
            case R.id.id_call_switch /*{ENCODED_INT: 2131296524}*/:
                if (this.mIdCallSwitch.isChecked()) {
                    FloatUtil.setPauseCall(this, true);
                    return;
                } else {
                    FloatUtil.setPauseCall(this, false);
                    return;
                }
            case R.id.id_change_layout /*{ENCODED_INT: 2131296534}*/:
                if (this.mIdChangeSwitch.isChecked()) {
                    this.mIdChangeSwitch.setChecked(false);
                    FloatUtil.setChangeData(this, false);
                    return;
                }
                this.mIdChangeSwitch.setChecked(true);
                FloatUtil.setChangeData(this, true);
                return;
            case R.id.id_change_switch /*{ENCODED_INT: 2131296535}*/:
                if (this.mIdChangeSwitch.isChecked()) {
                    FloatUtil.setChangeData(this, true);
                    return;
                } else {
                    FloatUtil.setChangeData(this, false);
                    return;
                }
            case R.id.id_close_allvibrate_layout /*{ENCODED_INT: 2131296550}*/:
                if (this.mIdCloseAllvibrateSwitch.isChecked()) {
                    this.mIdCloseAllvibrateSwitch.setChecked(false);
                    ActionAsSDK.setCloseAllVibrate(this, false);
                    return;
                }
                this.mIdCloseAllvibrateSwitch.setChecked(true);
                ActionAsSDK.setCloseAllVibrate(this, true);
                return;
            case R.id.id_close_allvibrate_switch /*{ENCODED_INT: 2131296551}*/:
                if (this.mIdCloseAllvibrateSwitch.isChecked()) {
                    ActionAsSDK.setCloseAllVibrate(this, true);
                    return;
                } else {
                    ActionAsSDK.setCloseAllVibrate(this, false);
                    return;
                }
            case R.id.id_create_switch /*{ENCODED_INT: 2131296566}*/:
                if (this.mIdCreateSwitch.isChecked()) {
                    ActionAsSDK.setCreateAutoNotic(this, true);
                    return;
                } else {
                    ActionAsSDK.setCreateAutoNotic(this, false);
                    return;
                }
            case R.id.id_createnotic_layout /*{ENCODED_INT: 2131296567}*/:
                if (this.mIdCreateSwitch.isChecked()) {
                    this.mIdCreateSwitch.setChecked(false);
                    ActionAsSDK.setCreateAutoNotic(this, false);
                    return;
                }
                this.mIdCreateSwitch.setChecked(true);
                ActionAsSDK.setCreateAutoNotic(this, true);
                return;
            case R.id.id_delay_layout /*{ENCODED_INT: 2131296578}*/:
                if (this.mIdDelaySwitch.isChecked()) {
                    this.mIdDelaySwitch.setChecked(false);
                    ActionAsSDK.setDelayUnitMs(this, false);
                    return;
                }
                this.mIdDelaySwitch.setChecked(true);
                ActionAsSDK.setDelayUnitMs(this, true);
                return;
            case R.id.id_delay_switch /*{ENCODED_INT: 2131296579}*/:
                if (this.mIdDelaySwitch.isChecked()) {
                    ActionAsSDK.setDelayUnitMs(this, true);
                    return;
                } else {
                    ActionAsSDK.setDelayUnitMs(this, false);
                    return;
                }
            case R.id.id_float_hide_layout /*{ENCODED_INT: 2131296652}*/:
                if (this.mIdFloatHideSwitch.isChecked()) {
                    this.mIdFloatHideSwitch.setChecked(false);
                    FloatUtil.setHideFloat(this, false);
                    return;
                }
                this.mIdFloatHideSwitch.setChecked(true);
                FloatUtil.setHideFloat(this, true);
                return;
            case R.id.id_float_hide_switch /*{ENCODED_INT: 2131296653}*/:
                if (this.mIdFloatHideSwitch.isChecked()) {
                    FloatUtil.setHideFloat(this, true);
                    return;
                } else {
                    FloatUtil.setHideFloat(this, false);
                    return;
                }
            case R.id.id_for_layout /*{ENCODED_INT: 2131296673}*/:
                if (this.mIdForSwitch.isChecked()) {
                    this.mIdForSwitch.setChecked(false);
                    ActionAsSDK.setWaitTime(this, false);
                    return;
                }
                this.mIdForSwitch.setChecked(true);
                ActionAsSDK.setWaitTime(this, true);
                return;
            case R.id.id_for_switch /*{ENCODED_INT: 2131296674}*/:
                if (this.mIdForSwitch.isChecked()) {
                    ActionAsSDK.setWaitTime(this, true);
                    return;
                } else {
                    ActionAsSDK.setWaitTime(this, false);
                    return;
                }
            case R.id.id_key_layout /*{ENCODED_INT: 2131296734}*/:
                choseDialog();
                return;
            case R.id.id_lock_layout /*{ENCODED_INT: 2131296754}*/:
                if (this.mIdLockSwitch.isChecked()) {
                    this.mIdLockSwitch.setChecked(false);
                    FloatUtil.setLockStop(this, false);
                    return;
                }
                this.mIdLockSwitch.setChecked(true);
                FloatUtil.setLockStop(this, true);
                return;
            case R.id.id_lock_switch /*{ENCODED_INT: 2131296755}*/:
                if (this.mIdLockSwitch.isChecked()) {
                    FloatUtil.setLockStop(this, true);
                    return;
                } else {
                    FloatUtil.setLockStop(this, false);
                    return;
                }
            case R.id.id_random_layout /*{ENCODED_INT: 2131296850}*/:
                if (this.mIdRandomSwitch.isChecked()) {
                    this.mIdRandomSwitch.setChecked(false);
                    ActionAsSDK.setSlipeRandom(this, false);
                    return;
                }
                this.mIdRandomSwitch.setChecked(true);
                ActionAsSDK.setSlipeRandom(this, true);
                return;
            case R.id.id_random_switch /*{ENCODED_INT: 2131296853}*/:
                if (this.mIdRandomSwitch.isChecked()) {
                    ActionAsSDK.setSlipeRandom(this, true);
                    return;
                } else {
                    ActionAsSDK.setSlipeRandom(this, false);
                    return;
                }
            case R.id.id_shortcut_layout /*{ENCODED_INT: 2131296900}*/:
                if (this.mIdShortcutSwitch.isChecked()) {
                    this.mIdShortcutSwitch.setChecked(false);
                    FloatUtil.setAutoShare(this, false);
                    return;
                }
                this.mIdShortcutSwitch.setChecked(true);
                FloatUtil.setAutoShare(this, true);
                return;
            case R.id.id_shortcut_switch /*{ENCODED_INT: 2131296901}*/:
                if (this.mIdShortcutSwitch.isChecked()) {
                    FloatUtil.setAutoShare(this, true);
                    return;
                } else {
                    FloatUtil.setAutoShare(this, false);
                    return;
                }
            case R.id.id_show_clickview_layout /*{ENCODED_INT: 2131296904}*/:
                if (this.mIdShowClickviewSwitch.isChecked()) {
                    this.mIdShowClickviewSwitch.setChecked(false);
                    FloatUtil.setClickView(this, false);
                    return;
                }
                this.mIdShowClickviewSwitch.setChecked(true);
                FloatUtil.setClickView(this, true);
                return;
            case R.id.id_show_clickview_switch /*{ENCODED_INT: 2131296905}*/:
                if (this.mIdShowClickviewSwitch.isChecked()) {
                    FloatUtil.setClickView(this, true);
                    return;
                } else {
                    FloatUtil.setClickView(this, false);
                    return;
                }
            case R.id.id_showxy_layout /*{ENCODED_INT: 2131296906}*/:
                if (this.mIdShowxySwitch.isChecked()) {
                    this.mIdShowxySwitch.setChecked(false);
                    FloatUtil.setViewXY(this, false);
                    MyApp.getInstance().showVieXY(false);
                    return;
                }
                this.mIdShowxySwitch.setChecked(true);
                FloatUtil.setViewXY(this, true);
                MyApp.getInstance().showVieXY(true);
                return;
            case R.id.id_showxy_switch /*{ENCODED_INT: 2131296907}*/:
                if (this.mIdShowxySwitch.isChecked()) {
                    FloatUtil.setViewXY(this, true);
                    MyApp.getInstance().showVieXY(true);
                    return;
                }
                FloatUtil.setViewXY(this, false);
                MyApp.getInstance().showVieXY(false);
                return;
            case R.id.id_track_layout /*{ENCODED_INT: 2131296969}*/:
                if (this.mIdTrackSwitch.isChecked()) {
                    this.mIdTrackSwitch.setChecked(false);
                    DataUtil.setTrackImg(this, false);
                    return;
                }
                this.mIdTrackSwitch.setChecked(true);
                DataUtil.setTrackImg(this, true);
                return;
            case R.id.id_track_switch /*{ENCODED_INT: 2131296970}*/:
                if (this.mIdTrackSwitch.isChecked()) {
                    DataUtil.setTrackImg(this, true);
                    return;
                } else {
                    DataUtil.setTrackImg(this, false);
                    return;
                }
            case R.id.id_vibrate_layout /*{ENCODED_INT: 2131296987}*/:
                if (this.mIdVibrateSwitch.isChecked()) {
                    this.mIdVibrateSwitch.setChecked(false);
                    FloatUtil.setAutoVibrate(this, false);
                    return;
                }
                this.mIdVibrateSwitch.setChecked(true);
                FloatUtil.setAutoVibrate(this, true);
                return;
            case R.id.id_vibrate_switch /*{ENCODED_INT: 2131296988}*/:
                if (this.mIdVibrateSwitch.isChecked()) {
                    FloatUtil.setAutoVibrate(this, true);
                    return;
                } else {
                    FloatUtil.setAutoVibrate(this, false);
                    return;
                }
            default:
                return;
        }
    }

    /* access modifiers changed from: private */
    /* access modifiers changed from: public */
    private void openWall() {
        YYPerUtils.image(this, "设置壁纸需要申请读取壁纸共享图片权限哦", new OnPerListener() {
            /* class com.lmiot.xyclick.Activity.AutoSettingActivity.AnonymousClass12 */

            @Override // com.youyi.yypermissionlibrary.SDK.OnPerListener
            public void result(boolean z, String str) {
                if (z) {
                    YYPerUtils.sd(AutoSettingActivity.this, "设置壁纸需要申请存储权限哦", new OnPerListener() {
                        /* class com.lmiot.xyclick.Activity.AutoSettingActivity.AnonymousClass12.AnonymousClass1 */

                        @Override // com.youyi.yypermissionlibrary.SDK.OnPerListener
                        public void result(boolean z, String str) {
                            if (z) {
                                DoubleUtils.getInstance().open(AutoSettingActivity.this);
                                return;
                            }
                            AutoSettingActivity.this.mIdSave.setChecked(false);
                            ToastUtil.warning("缺少必要权限！'");
                        }
                    });
                    return;
                }
                AutoSettingActivity.this.mIdSave.setChecked(false);
                ToastUtil.warning("软件需要申请存储权限才可以正常运行哦！'");
            }
        });
    }
}
